﻿using System.Collections.Generic;
using System.Runtime.Serialization;

namespace ClientOverflow.DataTransferObjects
{
    /// <summary>
    /// User class is a DTO representing a user from the server side. The DTO properties contains the
    /// user details and aggregates additional information such as related questions and answers.
    /// The class is decorated with [DataContract] attribute and the properties are decorated with
    /// [DataMember] attributes. Using the decorations the class is compatible as data trasnfer object
    /// in the WCF service.
    /// </summary>
    [DataContract]
    public class User
    {
        public User()
        {
            Department = new Department();
            Questions = new List<Question>();
            Answers = new List<Answer>();
        }

        [DataMember]
        public string Name { get; set; }

        [DataMember]
        public string Email { get; set; }

        [DataMember]
        public Department Department { get; set; }

        [DataMember]
        public string Password { get; set; }

        [DataMember]
        public List<Question> Questions { get; set; }

        [DataMember]
        public List<Answer> Answers { get; set; }
    }
}